package com.mcxx.constant;

import com.mcxx.util.EnumUtil;
import org.apache.commons.lang3.EnumUtils;

import java.util.HashMap;
import java.util.Map;

public enum BatchRecheckStatEnum {
        NEW("1","未确认"),COMMIT("2","已确认"),START("3","核对中"),EXIT("4","撤销"),GETSTATUS("","");

        BatchRecheckStatEnum(String key , String value){
            this.key = key ;
             this.value = value ;
        }

        private String key ;
        private  String value ;
        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

    public   String getValue(String key){
        return EnumUtil.getEnumValue(key,getEnumValues(this));
    }

    private   Map<String,String> getEnumValues(BatchRecheckStatEnum enu){
        Map<String,String> enumValues= new HashMap<String,String>();
        BatchRecheckStatEnum c = (BatchRecheckStatEnum) enu;
        BatchRecheckStatEnum [] cs = enu.values();

        for (int i = 0; i < cs.length; i++) {
            enumValues.put(cs[i].getKey(),cs[i].getValue());

        }
        return enumValues;
    }


    }
